<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module">
      import { Didact } from './index.js';

      function Counter() {
        return Didact.createElement(() => {
          const [count, setCount] = Didact.useState(0);

          return Didact.createElement(
            'h2',
            {
              onClick() {
                setCount((count) => count + 1);
              },
            },
            count,
          );
        });
      }

      const element = Counter();
      const container = document.querySelector('#root');
      Didact.render(element, container);
    </script>
  </body>
</html>
